// source --> https://www.amitel.gr/wp-content/themes/cleancut/js/prettyPhoto/js/jquery.prettyPhoto.js?ver=5.3.18 /* ------------------------------------------------------------------------ * Class: prettyPhoto * Use: Lightbox clone for jQuery * Author: Stephane Caron (http://www.no-margin-for-errors.com) * Version: 3.0.2 * ------------------------------------------------------------------------- */ (function($){$.prettyPhoto={version:'3.0.2'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({animation_speed:'fast',slideshow:false,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'facebook',hideflash:false,wmode:'opaque',autoplay:true,modal:false,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},markup:'
\
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\

\ Close \
\ Previous \

0/0

\ Next \
\
\
\
\
\
\
\
\
\
\
\
\
\
',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'
{content}
',custom_markup:''},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal) $.prettyPhoto.close();e.preventDefault();break;};};};});} $.prettyPhoto.initialize=function(){settings=pp_settings;if($.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));_buildOverlay(this);if(settings.allow_resize) $(window).bind('scroll.prettyphoto',function(){_center_overlay();});set_position=jQuery.inArray($(this).attr('href'),pp_images);$.prettyPhoto.open();return false;} $.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";_buildOverlay(event.target);pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;} if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(' ');movie_width=(parseFloat(grab_param('width',pp_images[set_position])))?grab_param('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(grab_param('height',pp_images[set_position])))?grab_param('height',pp_images[set_position]):settings.default_height.toString();if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;} if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;} $pp_pic_holder.fadeIn(function(){imgPreloader="";switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie='http://www.youtube.com/v/'+grab_param('v',pp_images[set_position]);if(settings.autoplay)movie+="&autoplay=1";toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[2]+'?title=0&byline=0&portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0){set_position=0;return;};}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1){set_position=0;}}else{set_position=direction;};if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage){currentGalleryPage=0;};}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0){currentGalleryPage=totalPage;};}else{currentGalleryPage=direction;};itemsToSlide=(currentGalleryPage==totalPage)?pp_images.length-((totalPage)*itemsPerPage):itemsPerPage;$pp_pic_holder.find('.pp_gallery li').each(function(i){$(this).animate({'left':(i*itemWidth)-((itemsToSlide*itemWidth)*currentGalleryPage)});});};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};} $.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;} $.prettyPhoto.close=function(){$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed').css('visibility','visible');$(this).remove();$(window).unbind('scroll');settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();$ppt.fadeTo(settings.animation_speed,1);projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();} if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand,a.pp_contract').hide();} if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+40,contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;} function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=(settings.theme=="facebook")?58:38;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_pic_holder.find('.pp_gallery .pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_gallery .pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_pic_holder.find('.pp_gallery ul li').each(function(i){$(this).css({'position':'absolute','left':i*itemWidth});$(this).find('a').unbind('click').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('Play') $pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});} $pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery); // source --> https://www.amitel.gr/wp-content/themes/cleancut/flashplayer/flowplayer-3.1.4.min.js?ver=5.3.18 /* * flowplayer.js 3.1.4. The Flowplayer API * * Copyright 2009 Flowplayer Oy * * This file is part of Flowplayer. * * Flowplayer is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Flowplayer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Flowplayer. If not, see . * * Date: 2009-02-25 21:24:29 +0000 (Wed, 25 Feb 2009) * Revision: 166 */ (function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p1){var r=arguments[1];var q=(arguments.length==3)?arguments[2]:{};if(typeof o=="string"){if(o.indexOf(".")!=-1){var t=[];m(n(o),function(){t.push(new b(this,k(r),k(q)))});return new d(t)}else{var s=c(o);return new b(s!==null?s:o,r,q)}}else{if(o){return new b(o,r,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var e=typeof jQuery=="function";var i={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:i}}function j(){if(c.done){return false}var l=document;if(l&&l.getElementsByTagName&&l.getElementById&&l.body){clearInterval(c.timer);c.timer=null;for(var k=0;k'}q.width=q.height=q.id=q.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+=''}}var o="";if(t){for(var m in t){if(t[m]!==null){o+=m+"="+(typeof t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='"}n+="";return n}function d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return m},getConf:function(){return p},getVersion:function(){return k},getFlashvars:function(){return l},getApi:function(){return m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var r=p.expressInstall;var o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="

Flash version "+q+" or greater is required

"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"

"+(m.tagName=="A"?"

Click here to download latest version

":"

Download latest version from here

");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var n=p.onFail.call(this);if(typeof n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof l=="string"){var n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof m=="string"){m={src:m}}var o=f({},i);f(o,m);return new d(l,o,k)};f(window.flashembed,{getVersion:function(){var m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var l=navigator.plugins["Shockwave Flash"].description;if(typeof l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(l.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return m}}try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof p=="object"){l=p.GetVariable("$version");if(typeof l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return m},isSupported:function(k){var m=flashembed.getVersion();var l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var m=null;this.each(function(){m=flashembed(this,l,k)});return l.api===false?this:m}}})(); // source --> https://www.amitel.gr/wp-content/themes/cleancut/js/custom.js?ver=5.3.18 jQuery.noConflict(); jQuery(document).ready(function(){ // ------------------------------------------------------------------------------------------- // START EDITING HERE // ------------------------------------------------------------------------------------------- var portfolioSorter = jQuery('.portfolio'); // selects the portfolio container portfolioSorter.kriesi_portfolio_sort({items:'.one_fourth'}); // activates portfolio sorting //on sites without portfolio activate basic image preloading if(portfolioSorter.length == 0) jQuery('.preloading').aviaSlider_preloadhelper({delay:100}); // activates the lightbox page my_lightbox("a[rel^='prettyPhoto'], a[rel^='lightbox']",true); // font replacement, remove this line if you want to use a different font defined in css, // or if the current font doesnt support some of your language specific characters cufont_replacement(); k_menu(); // controls the dropdown menu k_smoothscroll(); //smooth scrolling jQuery('.nav').k_nav_pointer({ fx: "easeOutQuint", speed: 700 }); // aviaslider variable preparation var newTransitionOrder = []; if(slideShowArray['transition_direction_final'] != undefined) { newTransitionOrder = slideShowArray['transition_direction_final'].split(", "); } if(newTransitionOrder[0] == "" || newTransitionOrder[0] == undefined) { newTransitionOrder = ['diagonaltop', 'diagonalbottom','topleft', 'bottomright', 'random']; } // aviaslider initialisation jQuery(".aviaslider").aviaSlider({ animationSpeed:slideShowArray['slider_transition'], // animation duration autorotation: slideShowArray['slide_autorotate'], // autorotation true or false? autorotationSpeed:slideShowArray['slide_duration'], // duration between autorotation switch in Seconds transition: slideShowArray['box_transition'], blockSize: {height: slideShowArray['box_height'], width:slideShowArray['box_width']}, //heigth and width of the blocks' betweenBlockDelay:slideShowArray['box_transition_delay'],// delay between each block change transitionOrder: newTransitionOrder, showText: true, // wether description text should be shown or not display: 'all', // showing up blocks: random, topleft, bottomright, diagonaltop, diagonalbottom, all switchMovement: false, // if display is set "topleft" it will switch to "br" every 2nd transition slideControlls: 'items', // which controlls should the be displayed for the user: none, items slides: '.featured', // wich element inside the container should serve as slide captionReplacement:'.feature_excerpt' }); // accordion slider jQuery(".accordion").kricordion({ slides: '.featured', // wich element inside the container should serve as slide animationSpeed:slideShowArray['slider_transition'], // animation duration autorotation: slideShowArray['slide_autorotate'], // autorotation true or false? autorotationSpeed:slideShowArray['slide_duration'], // duration between autorotation switch in Secondss event: 'mouseover', // event to focus a slide: mouseover or click imageShadow:false }); // news slider jQuery('.newsslider').kriesi_news_slider({ slides: '.featured', // wich element inside the container should serve as slide animationSpeed:slideShowArray['slider_transition'], // animation duration autorotation: slideShowArray['slide_autorotate'], // autorotation true or false? autorotationSpeed:slideShowArray['slide_duration'] // duration between autorotation switch in Seconds // duration between autorotation switch in Seconds }); // content switcher testimonials jQuery('#testimonial').kriesi_content_switch({event:'click', links:'.testimonial_author_pics a',contentContainer:'.testimonial_slides',content:'.t_slide'}); var templateUrl = jQuery("meta[name=temp_url]").attr('content'), formSendPath = templateUrl + '/send.php'; jQuery('.ajax_form').kriesi_ajax_form({sendPath:formSendPath}); // activates contact form jQuery('input:text').kriesi_empty_input({sendPath:formSendPath}); // comment form improvement /*Embedded Videos*/ var url = jQuery("meta[name=temp_url]").attr('content'); flowplayer(".videoplayer", {src: templateUrl + "/flashplayer/flowplayer-3.1.5.swf", wmode: "transparent", cachebusting: jQuery.browser.msie}, { // "videoplayer" is the class the player gets applied to clip: { autoPlay: true, autoBuffering: true }, plugins: { controls: { // display properties backgroundColor: '#333333', backgroundGradient: 'none', sliderColor: '#111111', progressColor: '#ffffff', bufferColor: '#aaaaaa', // controlbar-specific configuration fontColor: '#ffffff', timeFontColor: '#333333', autoHide: 'always' } ,controls: null //remove this line if you want to show controls } }); //activates the toggle shortcode js jQuery('#top').k_toggle(); jQuery('.tabcontainer').k_tabs(); k_pixelperfect(); // ------------------------------------------------------------------------------------------- // END EDITING HERE // ------------------------------------------------------------------------------------------- }); // ------------------------------------------------------------------------------------------- // portfolio sorting // ------------------------------------------------------------------------------------------- (function($) { $.fn.kriesi_portfolio_sort = function(options) { var defaults = { items: '.items', linkContainer:'#js_sort_items', filterItems: '.sort_by_cat', sortItems:'sort_by_val' }; var options = $.extend(defaults, options); return this.each(function() { var container = $(this), linkContainer = $(options.linkContainer), links = linkContainer.find('a'), items = container.find(options.items), itemLinks = items.find('a'), itemPadding = parseInt(items.css('paddingBottom')), itemSelection = '', columns = 0, coordinates = new Array(), animationArray = new Array(), columnPlus = new Array(); container.methods = { preloadingDone: function() { if(linkContainer.length > 0 && !($.browser.msie && $.browser.version < 7)) { //set container height, get all items and save coordinates container.css('height',container.height()); items.each(function() { var item = $(this), itemPos = item.position(); coordinates.push(itemPos); }) .each(function(i) { var item = $(this); item.css({position:'absolute', top: coordinates[i].top+'px', left: coordinates[i].left+'px'}); }); //set columns for(i = 0; i < coordinates.length; i++) { if(coordinates[i].top == coordinates[0].top) columns ++; } //show controlls linkContainer.css({opacity:0, visibility:"visible"}).animate({opacity:1}); // bind action to click events container.methods.bindfunctions(); } }, bindfunctions: function() { links.click(function() { var clickedElement = $(this), elementFilter = this.id; animationArray = new Array(); //apply active state clickedElement.parent().find('.active_sort').removeClass('active_sort'); this.className += ' active_sort'; // if we need to filter items if(clickedElement.parent().is(options.filterItems)) { var arrayIndex = 0, columnIndex = 0; columnPlus = new Array(); items.each(function(i) { var item = $(this); if(item.is('.'+elementFilter)) { animationArray.push( { element: item, animation: { opacity: 1, top: coordinates[arrayIndex].top, left: coordinates[arrayIndex].left }, height: item.height() }); if(columnTop < coordinates[arrayIndex].top) columnTop = coordinates[arrayIndex].top; columnIndex++; arrayIndex++; } else { animationArray.push( { element: item, animation: { opacity: 0 }, callback: true }); } if(items.length == i+1 || columnIndex == columns) { var columnTop = 0; for (x = 0; x < columnIndex; x++) { if(animationArray[i-x].height) { if(columnTop < animationArray[i-x].height) columnTop = animationArray[i-x].height; } else { columnIndex++; } } columnPlus.push(columnTop); columnIndex = 0; } if(i+1 == items.length) container.methods.startAnimation(); }); } else // if we need to sort items first { var sortitems = items.get(), reversed = false; if(clickedElement.is('.reversed')) reversed = true; sortitems.sort(function(a, b) { var compA = $(a).find('.'+elementFilter).text().toUpperCase(); var compB = $(b).find('.'+elementFilter).text().toUpperCase(); if (reversed) { return (compA < compB) ? 1 : (compA > compB) ? -1 : 0; } else { return (compA < compB) ? -1 : (compA > compB) ? 1 : 0; } }); items = $(sortitems); $(options.filterItems).find('.active_sort').trigger('click'); } return false; }); }, startAnimation: function() { var heightmodifier = coordinates[0].top, visibleElement = 0, currentCol = 0; for (i = 0; i < animationArray.length; i++) { if(animationArray[i].animation.top) { if(visibleElement % columns == 0 && visibleElement != 0) { heightmodifier += columnPlus[currentCol] + itemPadding; currentCol ++; } visibleElement++; } animationArray[i].animation.top = heightmodifier; animationArray[i].element.css('display','block').animate(animationArray[i].animation, 800, "easeInOutQuint", (function(i) { return function() { if(animationArray[i].callback == true) { animationArray[i].element.css({display:"none"}); } } })(i)); } var newContainerHeight = coordinates[0].top; for(z = 0; z < columnPlus.length; z++ ) { newContainerHeight += columnPlus[z] + itemPadding; } container.animate({height:newContainerHeight}, 800, "easeInOutQuint"); } } container.aviaSlider_preloadhelper({delay:100, callback:container.methods.preloadingDone}); }); } })(jQuery); // ------------------------------------------------------------------------------------------- // content switcher - used for testimonials // ------------------------------------------------------------------------------------------- (function($) { $.fn.kriesi_content_switch = function(options) { var defaults = { links: 'a', contentContainer:'ul', content: 'li', event:'mouseenter' }; var options = $.extend(defaults, options); return this.each(function() { var currentElement = $(this), linkItems = currentElement.find(options.links), contentContainer = currentElement.find(options.contentContainer), contentItems = currentElement.find(options.content), activeContainer = contentItems.filter(':visible'), inactiveContainer = contentItems.not(":visible"), testimonial_arrow = currentElement.find('.testimonial_arrow'); //prepare items: inactiveContainer.css({position:'absolute', opacity:0, display:'block', zIndex:1}); linkItems.each(function(i) { var currentLink = $(this); currentLink.bind(options.event+" click",function() { var currentLinkPos = currentLink.position(), arrowWidth = testimonial_arrow.width() / 2, currentLinkWidth = currentLink.width() / 2 testimonial_arrow.stop().animate({left:currentLinkPos.left - arrowWidth + currentLinkWidth + 4}); contentItems.stop().css({zIndex:1}).animate({opacity:0},700, function(){ $(this).css({position:'absolute'});}); contentItems.eq(i).stop().css({zIndex:4}).animate({opacity:1},400, function() { var item = $(this), itemHeight = item.height(), itemPadding = parseInt(item.css("paddingTop")) + parseInt(item.css("paddingBottom")) + 2; contentContainer.animate({height:itemHeight+itemPadding}); }); linkItems.removeClass('active_testimonial'); currentLink.addClass('active_testimonial'); return false; }); }); }); } })(jQuery); // ------------------------------------------------------------------------------------------- // input field improvements // ------------------------------------------------------------------------------------------- (function($) { $.fn.kriesi_empty_input = function(options) { return this.each(function() { var currentField = $(this); currentField.methods = { startingValue: currentField.val(), resetValue: function() { var currentValue = currentField.val(); if(currentField.methods.startingValue == currentValue) currentField.val(''); }, restoreValue: function() { var currentValue = currentField.val(); if(currentValue == '') currentField.val(currentField.methods.startingValue); } }; currentField.bind('focus',currentField.methods.resetValue); currentField.bind('blur',currentField.methods.restoreValue); }); } })(jQuery); // ------------------------------------------------------------------------------------------- // The News Slider // ------------------------------------------------------------------------------------------- (function($) { $.fn.kriesi_news_slider= function(options) { var defaults = { slides: '>li', // wich element inside the container should serve as slide animationSpeed: 900, // animation duration autorotation: true, // autorotation true or false? autorotationSpeed:3, // duration between autorotation switch in Seconds easing: 'easeOutQuint', backgroundOpacity:0.8 // opacity for background }; var options = $.extend(defaults, options); return this.each(function() { var slideWrapper = $(this), slides = slideWrapper.find(options.slides).css({display:'none',zIndex:0}), slideCount = slides.length, accelerator = 0, // accelerator of scrolling speed scrollInterval = '', // var that stores the setInterval id mousePos = '', // current mouse position moving = false, // scrollbar currently moving or not? controllWindowHeight = 0, // height of the wrapping element that hides overflow controllWindowPart = 0, // mouseoverpart of the wrapping element that hides overflow itemWindowHeight = 0, // height of element to move current_class = 'active_item', skipSwitch = true, currentSlideNumber = 0, newsSelect ='', newsItems = ''; slides.find('.feature_excerpt').css('opacity',options.backgroundOpacity); slideWrapper.methods = { init: function() { newsSelect = $('
  • ').addClass('newsselect').appendTo(slideWrapper); newsItems = $('
    ').addClass('newsItems').appendTo(newsSelect); fadeout = $('
  • ').addClass('fadeout').addClass('ie6fix').appendTo(slideWrapper); slides.filter(':eq(0)').css({zIndex:2, display:'block'}); slides.each(function(i) { var slide = $(this), url = slide.find('a').attr('href'); if(url != undefined) { var controll = $('').appendTo(newsItems).attr('href',url); current_class =''; } else { var controll = $('').appendTo(newsItems); current_class =''; } slide.find('.feature_excerpt .sliderheading, .feature_excerpt .sliderdate').clone().appendTo(controll); controll.bind('click', {currentSlideNumber: i}, slideWrapper.methods.switchSlide); }); controllWindowHeight = newsSelect.height(); controllWindowPart = controllWindowHeight/3; itemWindowHeight = newsItems.height(); if(slideCount > 1) { slideWrapper.aviaSlider_preloadhelper({delay:200}); slideWrapper.methods.preloadingDone(); } }, preloadingDone: function() { skipSwitch = false; var offset = newsSelect.offset(); newsSelect.mousemove(function(e) { mousePos = e.pageY - offset.top; if(!moving) { scrollInterval = setInterval(function() { slideWrapper.methods.scrollItem(mousePos); }, 25); moving = true; } }); newsSelect.bind('mouseleave', function() { clearInterval(scrollInterval); moving = false; accelerator = 0; }); }, scrollItem: function() { var movement = 0, percent = controllWindowPart / 100, modifier = 10, currentTop = parseInt(newsItems.css('top')); accelerator = accelerator <= 2 ? accelerator + 0.5 : accelerator; if(mousePos < controllWindowPart) { movement = ((controllWindowPart - mousePos) / percent) * accelerator; newPos = currentTop + (movement/modifier); if(currentTop < 0) { if (newPos > 0) newPos = 0; newsItems.css({top:newPos + "px"}); } } else if(mousePos > controllWindowPart * 2) { movement = ((mousePos - controllWindowPart * 2) / percent) * accelerator; newPos = currentTop + (movement/modifier * -1); if((currentTop * -1) < itemWindowHeight - controllWindowHeight) { if (newPos * -1 > itemWindowHeight - controllWindowHeight) newPos = controllWindowHeight - itemWindowHeight; newsItems.css({top:newPos + "px"}); } } else { accelerator = 0; } }, switchSlide: function(passed) { //workarround to make more than one flash movies with the same classname possible slides.find('>a>img, >span>img').css({opacity:1,visibility:'visible'}); var noAction = false; if(passed != undefined && !skipSwitch) { if(currentSlideNumber != passed.data.currentSlideNumber) { currentSlideNumber = passed.data.currentSlideNumber; } else { noAction = true; } } if(passed != undefined) { // clearInterval(interval); } if(!skipSwitch && noAction == false) { skipSwitch = true; var currentSlide = slides.filter(':visible'), nextSlide = slides.filter(':eq('+currentSlideNumber+')'); newsSelect.find('.active_item').removeClass('active_item'); newsSelect.find('.single_item:eq('+currentSlideNumber+')').addClass('active_item'); currentSlide.css({zIndex:4}); nextSlide.css({zIndex:2, display:'block'}); currentSlide.fadeOut(options.animationSpeed, function() { currentSlide.css({zIndex:0, display:"none"}); skipSwitch = false; }); } return false; }, autorotate: function() { //autorotation not yet supportet } }; slideWrapper.methods.init(); }); } })(jQuery); // ------------------------------------------------------------------------------------------- // The Main accordion slider - KRICORDION // Dependencies: equalheight function, kriesi_image_preoloader. jquery easing // // ------------------------------------------------------------------------------------------- (function($) { $.fn.kricordion = function(options) { var defaults = { slides: 'li', // wich element inside the container should serve as slide animationSpeed: 900, // animation duration autorotation: true, // autorotation true or false? autorotationSpeed:3, // duration between autorotation switch in Seconds easing: 'easeOutQuint', // animation easing, more options at the bottom of this file event: 'mouseover', // event to focus a slide: mouseover or click imageShadow:true, // should the image get a drop shadow to the left imageShadowStrength:0.5, // how dark should that shadow be, recommended values: between 0.3 and 0.8, allowed between 0 and 1 fontOpacity: 1, // opacity for font, if set to 1 it will be stronger but most browsers got a small rendering glitch at 1 backgroundOpacity:0.8 // opacity for background }; // merge default values with the values that were passed with the function call var options = $.extend(defaults, options); return this.each(function() { // save some jQuery selections into variables, also calculate base values for each slide var slideWrapper = $(this), // element that holds the slides slides = slideWrapper.find(options.slides).css('display','block'), // the slides slide_count = slides.length, // number of slides slide_width = slideWrapper.width() / slide_count // width of the slides expand_slide = slides.width(), // size of a slide when expanded, defined in css, class ".featured" by default minimized_slide = (slideWrapper.width() - expand_slide) / (slide_count - 1), // remaining width is shared among the non-active slides overlay_modifier = 200 *(1- options.imageShadowStrength), //increases the size of the minimized image div to avoid flickering excerptWrapper = slideWrapper.find('.feature_excerpt'), interval = '', current_slide = 0; //modify excerptWrapper and re-select it, also add positioning span ------------------------- excerptWrapper.wrap('').removeClass('feature_excerpt').addClass('position_excerpt'); excerptWrapper = slideWrapper.find('.feature_excerpt').css('opacity',options.backgroundOpacity); // ------------------------------------------------------------------------------------------- //equal heights for all excerpt containers, then hide basic excerpt content ----------------- excerptWrapper.equalHeights().find('.position_excerpt').css({display:'block', opacity:0, position:'absolute'}); var excerptWrapperHeight = excerptWrapper.height(); // ------------------------------------------------------------------------------------------- //iterate each slide and set new base values, also set positions for acitve and inactive states and event handlers slides.each(function(i) { var this_slide = $(this), // current slide element this_slide_a = this_slide.find('>a:first, >span:first'), // a tag inside the element real_excerpt = this_slide.find('.position_excerpt'), // wrapper to center the excerpt content verticaly feature_excerpt = this_slide.find('.feature_excerpt'), real_excerpt_height = real_excerpt.height(), // height of the excerpt content slide_heading =this_slide.find('.sliderheading'), // slide heading cloned_heading = slide_heading.clone().appendTo(this_slide_a) // clone heading for heading only view .addClass('heading_clone') .css({opacity:options.fontOpacity, width:slide_width-30}), clone_height = cloned_heading.height(), // height of clone heading, needed to center verticaly as well modifier = parseInt(feature_excerpt.css('paddingBottom')); this_slide.css('backgroundPosition',parseInt(slide_width/2-8) + 'px ' + parseInt((this_slide.height()- excerptWrapperHeight)/2 -8) + 'px'); cloned_heading.css({bottom: (excerptWrapperHeight-clone_height)/2 +modifier}); //center clone heading real_excerpt.css({bottom: (excerptWrapperHeight-real_excerpt_height)/2 +modifier}); //center real excerpt this_slide.data( //save data of each slide via jquerys data method 'data', { this_slides_position: i * slide_width, // position if no item is active pos_active_higher: i * minimized_slide, // position of the item if a higher item is active pos_active_lower: ((i-1) * minimized_slide) + expand_slide // position of the item if a lower item is active }); //set base properties this_slide.css({zIndex:i+1, left: i * slide_width, width:slide_width + overlay_modifier}); //apply the fading div if option is set to do so if(options.imageShadow) { this_slide.find('>a:first, >span:first').prepend(''); } }); // calls the preloader, aviaSlider_preloadhelper plugin needed slideWrapper.aviaSlider_preloadhelper({callback:add_functionality}); function add_functionality() { //set autorotation --------------------------------------------------------------------------- if(options.autorotation) { interval = setInterval(function() { autorotation(); }, (parseInt(options.autorotationSpeed) * 1000)); } slides.each(function(i) { var this_slide = $(this), real_excerpt = this_slide.find('.position_excerpt'), cloned_heading = this_slide.find('.heading_clone'); //set mouseover or click event this_slide.bind(options.event, function(event, continue_autoslide) { //stop autoslide on userinteraction if(!continue_autoslide) { clearInterval(interval) } var objData = this_slide.data( 'data' ); //on mouseover expand current slide to full size and fadeIn real content real_excerpt.stop().animate({opacity:options.fontOpacity},options.animationSpeed, options.easing); cloned_heading.stop().animate({opacity:0},options.animationSpeed, options.easing); this_slide.stop().animate({ width: expand_slide + (overlay_modifier * 1.2), left: objData.pos_active_higher}, options.animationSpeed, options.easing); //set and all other slides to small size slides.each(function(j){ if (i !== j) { var this_slide = $(this), real_excerpt = this_slide.find('.position_excerpt'), cloned_heading = this_slide.find('.heading_clone'), objData = this_slide.data( 'data' ), new_pos = objData.pos_active_higher; if(i < j) { new_pos = objData.pos_active_lower; } this_slide.stop().animate({left: new_pos, width:minimized_slide + overlay_modifier},options.animationSpeed, options.easing); real_excerpt.stop().animate({opacity:0},options.animationSpeed, options.easing); cloned_heading.stop().animate({opacity:options.fontOpacity},options.animationSpeed, options.easing); } }); }); }); //set mouseout event: expand all slides to no-slide-active position and width slideWrapper.bind('mouseleave', function() { slides.each(function(i) { var this_slide = $(this), real_excerpt = this_slide.find('.position_excerpt'), cloned_heading = this_slide.find('.heading_clone'), objData = this_slide.data( 'data' ), new_pos = objData.this_slides_position; this_slide.stop().animate({left: new_pos, width:slide_width + overlay_modifier},options.animationSpeed, options.easing); real_excerpt.stop().animate({opacity:0},options.animationSpeed, options.easing); cloned_heading.stop().animate({opacity:options.fontOpacity},options.animationSpeed, options.easing); }); }); } // autorotation function for the image slider function autorotation() { if(slide_count == current_slide) { slideWrapper.trigger('mouseleave'); current_slide = 0; } else { slides.filter(':eq('+current_slide+')').trigger(options.event,[true]); current_slide ++; } } }); }; })(jQuery); // ------------------------------------------------------------------------------------------- // END KRICORDION // ------------------------------------------------------------------------------------------- function k_smoothscroll() { jQuery('a[href*=#]').click(function() { var newHash=this.hash; if(newHash != '' && newHash != '#' ) { var target=jQuery(this.hash).offset().top, oldLocation=window.location.href.replace(window.location.hash, ''), newLocation=this, duration=800, easing='easeOutQuint'; // make sure it's the same location if(oldLocation+newHash==newLocation) { // animate to target and set the hash to the window.location after the animation jQuery('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() { // add new hash to the browser location window.location.href=newLocation; }); // cancel default click action return false; } } }); } function k_menu() { // k_menu controlls the dropdown menus and improves them with javascript jQuery(".nav a").removeAttr('title'); jQuery(" .nav ul ").css({display: "none"}); // Opera Fix //smooth drop downs jQuery(".nav li").each(function() { var $sublist = jQuery(this).find('ul:first'); jQuery(this).hover(function() { $sublist.stop().css({overflow:"hidden", height:"auto", display:"none"}).slideDown(400, function() { jQuery(this).css({overflow:"visible", height:"auto"}); }); }, function() { $sublist.stop().slideUp(400, function() { jQuery(this).css({overflow:"hidden", display:"none"}); }); }); }); } /** * LavaLamp - A menu plugin for jQuery with cool hover effects. * @requires jQuery v1.1.3.1 or above * * http://gmarwaha.com/blog/?p=7 * * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Version: 0.2.0 * Requires Jquery 1.2.1 from version 0.2.0 onwards. * For jquery 1.1.x, use version 0.1.0 of lavalamp */ (function($) { $.fn.k_nav_pointer = function(o) { o = $.extend({ fx: "linear", speed: 500, click: function(){} }, o || {}); return this.each(function() { $('.nav>.current_page_item').addClass('current-menu-item'); var me = $(this), noop = function(){}, $back = $('
  • ').appendTo(me), $li = $("li", this), curr = $("li.current-menu-item", this)[0], applytoall = false; if(curr == undefined) { $back.css('opacity',0); curr = $li[0]; applytoall = true; } $li.not(".back").not(".nav ul li").hover(function() { if(applytoall) { $back.stop().animate({'opacity':1}); } move(this); }, function(){ if(applytoall) { $back.stop().animate({'opacity':0}); } }); $(this).hover(noop, function() { move(curr); }); $li.click(function(e) { setCurr(this); return o.click.apply(this, [e, this]); }); setCurr(curr); function setCurr(el) { $back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" }); curr = el; }; function move(el) { $back.each(function() { $(this).dequeue(); } ).animate({ width: el.offsetWidth, left: el.offsetLeft }, o.speed, o.fx); }; }); }; })(jQuery); //equalHeights by james padolsey jQuery.fn.equalHeights = function() { return this.height(Math.max.apply(null, this.map(function() { return jQuery(this).height() }).get() )); }; function cufont_replacement() { var usedCSS = 1, colorset = new Array('1px 1px #ffffff', '-1px -1px #000000'); jQuery('link').each(function() { styleURL = jQuery(this).attr('href'); CSSnumber = styleURL.match(/style(\d).css/); if(CSSnumber && CSSnumber.length > 0) { usedCSS = CSSnumber[1]; } }); if(usedCSS == 2 ) { colorset = ['0px 0px #ffffff', '0px 0px #ffffff']; } else if(usedCSS == 3 || usedCSS == 5) { colorset = ['-1px -1px #111111', '-1px -1px #111111']; } else if(usedCSS == 4) { colorset = ['1px 1px #ffffff', '1px 1px #ffffff']; } Cufon.replace('h1,h2,h3,h4,h5,h6',{ fontFamily: 'quicksand', hover:'true', textShadow: colorset[0] }); Cufon.replace('#wrapper_heading h2',{ fontFamily: 'quicksand', hover:'true', textShadow: colorset[1] }); Cufon.replace('.heading',{ fontFamily: 'quicksand', hover:'true'}); } function my_lightbox($elements, autolink) { var theme_selected = 'light_square'; if(autolink) { jQuery('a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href$=".mov"] , a[href$=".swf"] , a[href*="vimeo.com"] , a[href*="youtube.com"]').contents("img").parent().each(function() { if(!jQuery(this).attr('rel') != undefined && !jQuery(this).attr('rel') != '' && !jQuery(this).hasClass('noLightbox')) { jQuery(this).attr('rel','lightbox[auto_group]') } }); } jQuery($elements).prettyPhoto({ "theme": theme_selected /* light_rounded / dark_rounded / light_square / dark_square */ }); jQuery($elements).each(function() { var $image = jQuery(this).contents("img"); $newclass = 'lightbox_video'; if(jQuery(this).attr('href').match(/(jpg|gif|jpeg|png|tif)/)) $newclass = 'lightbox_image'; if ($image.length > 0) { if(jQuery.browser.msie && jQuery.browser.version < 7) jQuery(this).addClass('ie6_lightbox'); var $bg = jQuery("").appendTo(jQuery(this)); jQuery(this).bind('mouseenter', function() { var $height = $image.height(), $width = $image.width(), $pos = $image.position(), $paddingX = parseInt($image.css('paddingTop')) + parseInt($image.css('paddingBottom')), $paddingY = parseInt($image.css('paddingLeft')) + parseInt($image.css('paddingRight')); $bg.css({height:$height + $paddingY, width:$width + $paddingX, top:$pos.top, left:$pos.left}); }); } }); jQuery($elements).contents("img").hover(function() { jQuery(this).stop().animate({opacity:0.4},400); }, function() { jQuery(this).stop().animate({opacity:1},400); }); } (function($) { $.fn.kriesi_ajax_form = function(options) { var defaults = { sendPath: 'send.php', responseContainer: '.ajaxresponse' }; var options = $.extend(defaults, options); return this.each(function() { var form = $(this), send = { formElements: form.find('textarea, select, input:text, input[type=hidden]'), validationError:false, button : form.find('input:submit'), datastring : '' }; send.button.bind('click', checkElements); function send_ajax_form() { send.button.fadeOut(300); $.ajax({ type: "POST", url: options.sendPath, data:send.datastring, success: function(response) { var message = $("").addClass(options.responseContainer) .css('display','none') .insertBefore(form) .html(response); form.slideUp(400, function(){message.slideDown(400), send.formElements.val('');}); } }); } function checkElements() { // reset validation var and send data send.validationError = false; send.datastring = 'ajax=true'; send.formElements.each(function(i) { var currentElement = $(this), surroundingElement = currentElement.parent(), value = currentElement.val(), name = currentElement.attr('name'), classes = currentElement.attr('class'), nomatch = true; send.datastring += "&" + name + "=" + value; if(classes.match(/is_empty/)) { if(value == '') { surroundingElement.attr("class","").addClass("error"); send.validationError = true; } else { surroundingElement.attr("class","").addClass("valid"); } nomatch = false; } if(classes.match(/is_email/)) { if(!value.match(/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/)) { surroundingElement.attr("class","").addClass("error"); send.validationError = true; } else { surroundingElement.attr("class","").addClass("valid"); } nomatch = false; } if(nomatch && value != '') { surroundingElement.attr("class","").addClass("valid"); } }); if(send.validationError == false) { send_ajax_form(); } return false; } }); } })(jQuery); /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); function k_pixelperfect() { if(jQuery.browser.opera) // opera somewhat sucks when something is alligned with pos absolute and bottom { //hide fancyborders, doesnt work jQuery('.fancyborder').css({display:'none'}); //set background image sidebar var sbHeight = jQuery('.sidebar').height(); jQuery('.sidebar_bottom').css({top:sbHeight}); } jQuery('.wp-caption').each(function() { var current_caption = jQuery(this), current_img= current_caption.find('img'); current_caption.css('width',current_img.width() + parseInt(current_img.css('paddingLeft'))+ parseInt(current_img.css('paddingRight'))); }); if(jQuery.browser.msie && jQuery.browser.version < 8) { jQuery('.testimonial_slides').css('paddingTop','25px'); if(jQuery.browser.version < 7) { jQuery('.fancyborder').css({display:'none'}); } } var commentform = jQuery('#commentform'); commentform.find('#submit').bind('mousedown', function() { var website = commentform.find('#url'); if (website.val() == 'Website' || website.val() == 'http://Website') { website.val("");} }); } (function($) { $.fn.k_toggle = function(options) { var defaults = { heading: '.toggler', content:'.toggle' }; var options = $.extend(defaults, options); return this.each(function() { var container = $(this), heading = $(options.heading, container), allContent = $(options.content, container); heading.bind('click', function() { var thisheading = $(this); content = thisheading.next(options.content, container); if(content.is('.open')) { content.removeClass('open').slideUp(500); thisheading.removeClass('activeTitle'); } else { if(thisheading.is('.closeAll')) { allContent.removeClass('open').slideUp(500); heading.removeClass('activeTitle'); } content.addClass('open').slideDown(500); thisheading.addClass('activeTitle'); } }); }); } })(jQuery); (function($) { $.fn.k_tabs= function(options) { var defaults = { heading: '.tab', content:'.tab_content' }; var options = $.extend(defaults, options); return this.each(function() { var container = $(this), tabs = $(options.heading, container), content = $(options.content, container); // sort tabs tabs.prependTo(container); $('p:empty').remove(); tabs.each(function(i) { $(this).bind('click', function() { var tab = $(this); if(!tab.is('.active_tab')) { $('.active_tab', container).removeClass('active_tab'); $('.active_tab_content', container).removeClass('active_tab_content'); tab.addClass('active_tab'); content.filter(':eq('+i+')').addClass('active_tab_content'); } }); }); }); } })(jQuery); /** * AviaSlider - A jQuery image slider * (c) Copyright Christian "Kriesi" Budschedl * http://www.kriesi.at * http://www.twitter.com/kriesi/ * For sale on ThemeForest.net */ /* this prevents dom flickering, needs to be outside of dom.ready event: */ document.documentElement.className += 'js_active'; /*end dom flickering =) */ (function($) { $.fn.aviaSlider= function(variables) { var defaults = { slides: 'li', // wich element inside the container should serve as slide animationSpeed: 900, // animation duration autorotation: true, // autorotation true or false? autorotationSpeed:3, // duration between autorotation switch in Seconds appendControlls: '', // element to apply controlls to slideControlls: 'items', // controlls, yes or no? blockSize: {height: 'full', width:'full'}, betweenBlockDelay:60, display: 'topleft', switchMovement: false, showText: true, captionReplacement: false, //if this is set the element will be used for caption instead of the alt tag transition: 'fade', //slide, fade or drop backgroundOpacity:0.8, // opacity for background transitionOrder: ['diagonaltop', 'diagonalbottom','topleft', 'bottomright', 'random'] }; var options = $.extend(defaults, variables); return this.each(function() { var slideWrapper = $(this), //wrapper element slides = slideWrapper.find(options.slides), //single slide container slideImages = slides.find('img'), //slide image within container slideCount = slides.length, //number of slides slideWidth = slides.width(), //width of slidecontainer slideHeight= slides.height(), //height of slidecontainer blockNumber = 0, //how many blocks do we need currentSlideNumber = 0, //which slide is currently shown reverseSwitch = false, //var to set the starting point of the transition currentTransition = 0, //var to set which transition to display when rotating with 'all' current_class = 'active_item', //currently active controller item controlls = '', //string that will contain controll items to append skipSwitch = true, //var to check if performing transition is allowed interval ='', blockSelection ='', blockSelectionJQ ='', blockOrder = []; //check if either width or height should be full container width if (options.blockSize.height == 'full') { options.blockSize.height = slideHeight; } else { options.blockSize.height = parseInt(options.blockSize.height)} if (options.blockSize.width == 'full') { options.blockSize.width = slideWidth; } else { options.blockSize.width = parseInt(options.blockSize.width)} //slider methods that controll the whole behaviour of the slideshow slideWrapper.methods = { //initialize slider and create the block with the size set in the default/options object init: function() { var posX = 0, posY = 0, generateBlocks = true, bgOffset = ''; // make sure to display the first image in the list at the top slides.filter(':first').css({'z-index':'5',display:'block'}); // start generating the blocks and add them until the whole image area // is filled. Depending on the options that can be only one div or quite many ;) while(generateBlocks) { blockNumber ++; bgOffset = "-"+posX +"px -"+posY+"px"; $('
    ').appendTo(slideWrapper).css({ zIndex:20, position:'absolute', display:'none', left:posX, top:posY, height:options.blockSize.height, width:options.blockSize.width, backgroundPosition:bgOffset }); posX += options.blockSize.width; if(posX >= slideWidth) { posX = 0; posY += options.blockSize.height; } if(posY >= slideHeight) { //end adding Blocks generateBlocks = false; } } //setup directions blockSelection = slideWrapper.find('.kBlock'); blockOrder['topleft'] = blockSelection; blockOrder['bottomright'] = $(blockSelection.get().reverse()); blockOrder['diagonaltop'] = slideWrapper.methods.kcubit(blockSelection); blockOrder['diagonalbottom'] = slideWrapper.methods.kcubit(blockOrder['bottomright']); blockOrder['random'] = slideWrapper.methods.fyrandomize(blockSelection); //save image in case of flash replacements, will be available in the the next script version slides.each(function() { $.data(this, "data", { img: $(this).find('img').attr('src')}); }); if(slideCount <= 1) { slideWrapper.aviaSlider_preloadhelper({delay:200}); } else { slideWrapper.aviaSlider_preloadhelper({callback:slideWrapper.methods.preloadingDone}); slideWrapper.methods.appendControlls(); } slideWrapper.methods.addDescription(); }, //appends the click controlls after an element, if that was set in the options array appendControlls: function() { if (options.slideControlls == 'items') { var elementToAppend = options.appendControlls || slideWrapper[0]; controlls = $('
    ').addClass('slidecontrolls').insertAfter(elementToAppend); slides.each(function(i) { var controller = $('').appendTo(controlls); controller.bind('click', {currentSlideNumber: i}, slideWrapper.methods.switchSlide); current_class = ""; }); controlls.width(controlls.width()).css('float','none'); } return this; }, // adds the image description from an alttag addDescription: function() { if(options.showText) { slides.each(function() { var currentSlide = $(this); if(options.captionReplacement) { var description = currentSlide.find(options.captionReplacement).css({display:'block','opacity':options.backgroundOpacity}); } else { var description = currentSlide.find('img').attr('alt'), splitdesc = description.split('::'); if(splitdesc[0] != "" ) { if(splitdesc[1] != undefined ) { description = ""+splitdesc[0] +""+splitdesc[1]; } else { description = splitdesc[0]; } } if(description != "") { $('
    ').addClass('feature_excerpt') .html(description) .css({display:'block', 'opacity':options.backgroundOpacity}) .appendTo(currentSlide.find('a')); } } }); } }, preloadingDone: function() { skipSwitch = false; if($.browser.msie) { slides.css({'backgroundColor':'#000000','backgroundImage':'none'}); } else { slides.css({'backgroundImage':'none'}); } if(options.autorotation && options.autorotation != 2) { slideWrapper.methods.autorotate(); slideImages.bind("click", function(){ clearInterval(interval); }); } }, autorotate: function() { var time = parseInt(options.autorotationSpeed) * 1000 + parseInt(options.animationSpeed) + (parseInt(options.betweenBlockDelay) * blockNumber); interval = setInterval(function() { currentSlideNumber ++; if(currentSlideNumber == slideCount) currentSlideNumber = 0; slideWrapper.methods.switchSlide(); }, time); }, switchSlide: function(passed) { var noAction = false; if(passed != undefined && !skipSwitch) { if(currentSlideNumber != passed.data.currentSlideNumber) { currentSlideNumber = passed.data.currentSlideNumber; } else { noAction = true; } } if(passed != undefined) clearInterval(interval); if(!skipSwitch && noAction == false) { skipSwitch = true; var currentSlide = slides.filter(':visible'), nextSlide = slides.filter(':eq('+currentSlideNumber+')'), nextURL = $.data(nextSlide[0], "data").img, nextImageBG = 'url('+nextURL+')'; if(options.slideControlls) { controlls.find('.active_item').removeClass('active_item'); controlls.find('a:eq('+currentSlideNumber+')').addClass('active_item'); } blockSelectionJQ = blockOrder[options.display]; //workarround to make more than one flash movies with the same classname possible slides.find('>a>img').css({opacity:1,visibility:'visible'}); //switchmovement if(options.switchMovement && (options.display == "topleft" || options.display == "diagonaltop")) { if(reverseSwitch == false) { blockSelectionJQ = blockOrder[options.display]; reverseSwitch = true; } else { if(options.display == "topleft") blockSelectionJQ = blockOrder['bottomright']; if(options.display == "diagonaltop") blockSelectionJQ = blockOrder['diagonalbottom']; reverseSwitch = false; } } if(options.display == 'random') { blockSelectionJQ = slideWrapper.methods.fyrandomize(blockSelection); } if(options.display == 'all') { blockSelectionJQ = blockOrder[options.transitionOrder[currentTransition]]; currentTransition ++; if(currentTransition >= options.transitionOrder.length) currentTransition = 0; } //fire transition blockSelectionJQ.css({backgroundImage: nextImageBG}).each(function(i) { var currentBlock = $(this); setTimeout(function() { var transitionObject = new Array(); if(options.transition == 'drop') { transitionObject['css'] = {height:1, width:options.blockSize.width, display:'block',opacity:0}; transitionObject['anim'] = {height:options.blockSize.height,width:options.blockSize.width,opacity:1}; } else if(options.transition == 'fade') { transitionObject['css'] = {display:'block',opacity:0}; transitionObject['anim'] = {opacity:1}; } else { transitionObject['css'] = {height:1, width:1, display:'block',opacity:0}; transitionObject['anim'] = {height:options.blockSize.height,width:options.blockSize.width,opacity:1}; } currentBlock .css(transitionObject['css']) .animate(transitionObject['anim'],options.animationSpeed, function() { if(i+1 == blockNumber) { slideWrapper.methods.changeImage(currentSlide, nextSlide); } }); }, i*options.betweenBlockDelay); }); } // end if(!skipSwitch && noAction == false) return false; }, changeImage: function(currentSlide, nextSlide) { currentSlide.css({zIndex:0, display:'none'}); nextSlide.css({zIndex:3, display:'block'}); blockSelectionJQ.fadeOut(options.animationSpeed*1/3, function(){ skipSwitch = false; }); }, // array sorting fyrandomize: function(object) { var length = object.length, objectSorted = $(object); if ( length == 0 ) return false; while ( --length ) { var newObject = Math.floor( Math.random() * ( length + 1 ) ), temp1 = objectSorted[length], temp2 = objectSorted[newObject]; objectSorted[length] = temp2; objectSorted[newObject] = temp1; } return objectSorted; }, kcubit: function(object) { var length = object.length, objectSorted = $(object), currentIndex = 0, //index of the object that should get the object in "i" applied rows = Math.ceil(slideHeight / options.blockSize.height), columns = Math.ceil(slideWidth / options.blockSize.width), oneColumn = blockNumber/columns, oneRow = blockNumber/rows, modX = 0, modY = 0, i = 0, rowend = 0, endreached = false, onlyOne = false; if ( length == 0 ) return false; for (i = 0; i oneRow)|| (modY + 1) % oneColumn == 0) { currentIndex -= (((oneRow - 1) * modY) - 1); modY = 0; modX ++; onlyOne = false; if (rowend > 0) { modY = rowend; currentIndex += (oneRow -1) * modY; } } else { currentIndex += oneRow -1; modY ++; } if((modX % (oneRow-1) == 0 && modX != 0 && rowend == 0) || (endreached == true && onlyOne == false) ) { modX = 0.1; rowend ++; endreached = true; onlyOne = true; } } return objectSorted; } }; slideWrapper.methods.init(); }); }; })(jQuery); (function($) { $.fn.aviaSlider_preloadhelper = function(variables, callback) { var defaults = { fadeInSpeed: 800, maxLoops: 10, callback: '' }; var options = $.extend(defaults, variables); return this.each(function() { var container = $(this), images = $('img', this).css({opacity:0, visibility:'visible', display:'block'}), parent = images.parent(), imageCount = images.length, interval = '', allImages = images ; var methods = { checkImage: function() { images.each(function(i) { if(this.complete == true) images = images.not(this); }); if(images.length && options.maxLoops >= 0) { options.maxLoops--; setTimeout(methods.checkImage, 500); } else { methods.showImages(); } }, showImages: function() { allImages.each(function(i) { var currentImage = $(this); currentImage.animate({opacity:1}, options.fadeInSpeed, function() { if(allImages.length == i+1) methods.callback(i); }); }); }, callback: function() { if (variables instanceof Function) { callback = variables; } if (callback instanceof Function) { callback.call(this); } if(options.callback != '') (options.callback)(); } }; methods.checkImage(); }); }; })(jQuery);